vcBehaviors - Module

vcBehaviors module.

See in: Overview

Classes (top-level): vcActionConnectionType, vcAxisAlignType, vcBehaviorType, vcInterpolationType, vcJogInfoCursorAction, vcLanguageType, ... (see more)
vcActionConnectionType
vcAxisAlignType
vcBehaviorType
vcInterpolationType
vcJogInfoCursorAction
vcLanguageType
vcMotionDirection
vcMotionState
vcNodeAssemblyGrabMode
vcRoutingComponentMethod
vcSignalConnectionType
vcSignalMapDirection
vcSimInterfaceFieldType
vcStatisticsState
vcTriggerPosition
vcVolumeSensorTestMethod
vcObject

Enums: vcActionConnectionType, vcAxisAlignType, vcBehaviorType, vcInterpolationType, vcJogInfoCursorAction, vcLanguageType, ... (see more)
vcActionConnectionType
vcAxisAlignType
vcBehaviorType
vcInterpolationType
vcJogInfoCursorAction
vcLanguageType
vcMotionDirection
vcMotionState
vcNodeAssemblyGrabMode
vcRoutingComponentMethod
vcSignalConnectionType
vcSignalMapDirection
vcSimInterfaceFieldType
vcStatisticsState
vcTriggerPosition
vcVolumeSensorTestMethod

Example: Import

"""Import module with an alias name."""
import vcBehaviors as vc_beh

Example: Create New Behavior

""" This example shows how to create a new behavior. """

import vcCore as vc
import vcBehaviors as vc_beh

comp = vc.getComponent()
sensor_signal = comp.createBehavior(vc_beh.vcBehaviorType.BOOLEAN_SIGNAL, "SensorSignal")

Example: Find First Behavior by Type

import vcCore as vc
import vcBehaviors as vc_beh

comp = vc.getComponent()

# find the first boolean signal behavior on the component
beh = comp.findBehavior(vc_beh.vcBehaviorType.BOOLEAN_SIGNAL)

Example: Find Behaviors by Type

import vcCore as vc
import vcBehaviors as vc_beh

comp = vc.getComponent()

def find_behaviors_by_type(comp, the_type):
  return [b for b in comp.getBehaviors() if b.Type == the_type]
  
# find all boolean signal behaviors on the component
behs = find_behaviors_by_type(comp,vc_beh.vcBehaviorType.BOOLEAN_SIGNAL)

Example: Delete Behavior

""" Deletes a behavior. """

import vcCore as vc
import vcBehaviors as vc_beh

comp = vc.getComponent()
sensor_signal = comp.findBehavior("SensorSignal")
sensor_signal.delete()